<div class="layui-fluid">
    <div class="layui-breadcrumb jy-breadcrumb">

    </div>
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-list-form">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">用户名</label>
                    <div class="layui-input-block">
                        <select name="id" xm-select="user" xm-select-search="/index/User/getUserByName"  xm-select-radio="">
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn search" lay-submit lay-filter="LAY-list-search">搜索</button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">
            <table id="LAY-list"  lay-filter="LAY-list"></table>
            <!-- 行内工具 -->
            <script type="text/html" id="LAY-list-toolbar">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-href="User/edit/id={{d.id}}">编辑</a>
            </script>
        </div>
    </div>
</div>

<script>
    layui.use(['admin', 'table', 'form','toolJ','formSelects'], function () {
        var $ = layui.$
            , admin = layui.admin
            , view = layui.view
            , table = layui.table
            ,formSelects = layui.formSelects
            , toolJ = layui.toolJ
            , form = layui.form;
        form.render(null, 'LAY-list-form');
        formSelects.render();
        //用户管理
        table.render({
            elem: '#LAY-list'
            ,url: '/index/user/getList'
            ,cellMinWidth:80
            ,cols: [[
                {field: 'id', title: 'ID'}
                ,{field: 'nike', title: '中文名'}
                ,{field: 'name', title: '用户名'}
                ,{field: 'role', title: '角色'}
                ,{field: 'operat_user', title: '最后操作人'}
                ,{field: 'operat_time', title: '操作时间'}
                ,{field: 'status', title: '状态'}
                ,{title: '操作', align:'center', fixed: 'right', toolbar: '#LAY-list-toolbar'}
            ]]
            ,page: true
            ,limit: 10
            ,text:{none: '暂无相关数据!' }
        });


    });
</script>